package com.authority.service;


import java.util.List;

import com.authority.entry.AuthActionDO;
import com.authority.entry.AuthMenuActionDO;
import com.authority.entry.AuthMenuDO;
import com.authority.query.AuthMenuQuery;
import com.authority.query.AuthRoleQuery;
import com.authority.result.PageResult;
import com.authority.tree.Node;
import com.authority.vo.AuthMenuVO;
import com.authority.vo.AuthRoleVO;

/**
 * 菜单管理
 *
 * @author 李远 Date 2015/10/20
 */
public interface AuthMenuService {

	/**
	 * 添加菜单
	 * 
	 * @param db 菜单
	 * @param list 功能列表
	 * @return
	 * @throws Exception 
	 */
	void saveAuthMenu(AuthMenuDO db,List<AuthMenuActionDO> list) throws Exception;

	/**
	 * 修改菜单
	 * @param db 菜单
	 * @param list 功能列表
	 * @return
	 * @throws Exception 
	 */
	void updateAuthMenu(AuthMenuDO db, Long operatorId,String actions,String deletedActions) throws Exception;

	/**
	 * 删除
	 * 
	 * @param ids
	 * @return
	 */
	int deleteAuthMenuByids(String ids,Long sysId);
	
	/**
	 * 获取菜单基本信息
	 * @param id
	 * @return
	 * @throws Exception 
	 */
	AuthMenuDO getAuthMenuById(Long id) throws Exception;
	
	/**
	 * 获取菜单详情
	 * @param id
	 * @return
	 * @throws Exception 
	 */
	AuthMenuVO getAuthMenuDetailById(Long id) throws Exception;

	/**
	 * 获取指定系统的菜单列表
	 * @param sysId
	 * @return
	 */
	List<AuthMenuDO> listAuthMenuBySysId(Long sysId);
	
	
	/**
	 * 获取指定系统的菜单树
	 * @param sysId
	 * @return
	 */
	Node treeAuthMenuBySysId(Long sysId);
	
	
	/**
	 * 
	 * 获取菜单下的所有功能 
	 * @return
	 */
	List<AuthActionDO> listAuthActionByMenuIdAndSysId(Long menuId,Long sysId);

	/**
	 * 删除菜单
	 * @param menuId
	 * @param sysId
	 */
	void removeAuthMenu(Long menuId,Long sysId);
	
	/**
	 * 删除菜单树
	 * @param menuId
	 * @param sysId
	 */
	void removeAuthMenuTree(Long menuId,Long sysId);
	
	void saveAuthMenu(AuthMenuVO authMenuVo) throws Exception;
	
	void updateAuthMenu(AuthMenuVO authMenuVo) throws Exception;
	
	PageResult<AuthMenuVO> listAuthMenu(AuthMenuQuery query) throws Exception;
	
}